package org.example.utils;

import java.net.*;
import java.util.concurrent.ExecutionException;

/**
 * IP工具类
 */
public class IpUtil {
    /**
     * 获取本机本地IP
     */
    public static String getLocalIp(){
        InetAddress ia = null;
        String ip = null;
        try {
            ia = ia.getLocalHost();
            ip = ia.getHostAddress();
        } catch (Exception  e) {
            throw new RuntimeException(e);
        }
        return ip;
    }
    
//    public static void main(String[] args) {
//        getLocalIp();
//    }
}